 <link rel="stylesheet" href="/stylesheets/calendar/blue/style.css">


  <script type='text/javascript'>
    function displaymessage(date)
    {
      location.href='/calendar_clients/detail_page?timeframe=day&date='+'<%=@year%>'+'-'+'<%=@month%>'+'-'+date;
    }

    function cellOver(cellOb,cellText)
    {
      var tooltip="";
      var films="";
      var others="";
      var holidays="";

    <%@event_ob.sort_by {|u| u.start}.each{|r|%>

      <%dateTimeStart=DateTime.parse(r.start.to_s)%>
      <%dateTimeEnd=DateTime.parse(r.end.to_s)%>

          var cell="<%=dateTimeStart.mday%>";

          if(cell==cellText){


      <%if r.event_type=="film"%>
              films=films+"<font size='2'><b> <%=r.title %></b><br> "+

                " Description : <%=r.content.to_s %></font><br><br>"

      <%else%>

         <%if r.event_type=="holiday"%>
              holidays=holidays+"<font size='2'><b> <%=r.title %></b><br><br>"

        <%else%>

                others=others+"<font size='2'><b><%=dateTimeStart.strftime("%I:%M%p") %>"+
                "<%=dateTimeEnd.strftime(" to %I:%M%p") %> : <%=r.title %></b><br> Location : "+
                "<%=r.where %><br> Description : <%=r.content.to_s %></font><br><br>"
        <%end%>


      <%end%>



          }
    <%} if not @event_ob.nil? %>

    if (holidays!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Holidays</b></font><br>"+holidays
    }

    if (films!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Films</b></font><br>"+films
    }
    if (others!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Special Events</b></font><br>"+others
    }

    if(tooltip!=""){
      Tip(tooltip);
    }



<%#*cellOb.style.backgroundColor='#ffffff';%>

  }

  function colorChangeOut(cellOb)
  {
<%#*hideddrivetip();%>

  }

  </script>





 <h3 style="font-size:1.2em;color:black">Events Calendar</h3>

<table border="1">
  <tr>
    <td style="background-color:#F0F0F0" class="cal_container" >

      <%=calendar(:previous_month_text   => "&lt;&lt;Prev",:next_month_text   =>"Next&gt;&gt;",:year => @year.to_i, :month => @month.to_i) do |d|




         types=[]
         @events_details.each{|key,value|
            if not @events_details[key]["array"].nil? and @events_details[key]["array"].include?(d)

                 types.push(key)
             end

         } if not @events_details.nil?


         case(types.size)
         when 0

          when 1
           if types.include?("holiday")

            if d.wday==0 or d.wday==6
              [d.mday, {:class => "day weekendDay",:style=>"background-image: url(/images/calendar_images/holiday_star.gif);background-repeat:no-repeat"}]
            else
              [d.mday, {:class => "day",:style=>"background-image: url(/images/calendar_images/holiday_star.gif);background-repeat:no-repeat"}]
            end

           else
             colour=@events_details[types[0]]["colour"]
             [d.mday, {:class => "specialDay",:style=>"background-color:#{colour}"}]
           end

          when 2

              if types.include?("holiday")
                if types[0]=="holiday"
                  colour=@events_details[types[1]]["colour"]
                else
                  colour=@events_details[types[0]]["colour"]
                end

                 [d.mday, {:class => "specialDay",:style=>"background-color:#{colour};background-image:url(/images/calendar_images/holiday_star.gif);background-repeat:no-repeat"}]
              else
                [d.mday, {:class => "film_and_event"}]
              end

         else

              if types.include?("holiday")

                [d.mday, {:class => "mixed_events_and_holiday"}]
              else
                [d.mday, {:class => "film_and_event"}]
              end


         end





      end
    %>
    </td>
  </tr>
  <tr>
    <td>
       <%#*<ul style="font-size:11px">%>
              <%#*<li style="color:blue">&yen; Today%>
              <%#*<li style="color:orange">&yen; Holidays%>
              <%#*<li style="color:green">&yen; Movies Starting Dates%>
              <%#*<li style="color:red">&yen; Parties,Concerts and Others%>

       <%#*</ul>%>
       <table style="font-size:0.8em">
          <tr>
            <td style="color:blue;" width="60" >&nbsp;&yen; Today</td>
             <td style="color:#FFCC33"><img width="10" height="10" src="/images/calendar_images/holiday_star.gif"> Holidays</td>
          </tr>

       </table>

       <hr style="color:#F0F0F0">
    </td>
  </tr>

</table>

